package com.test;

import java.util.Scanner;
import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

public class Exp2B {
	private BlockingDeque<String> blockingDeque = new LinkedBlockingDeque<String>();
	
	public static void main(String[] args) {
		Exp2B exp2b = new Exp2B();
		exp2b.new ReadThread().start();
		exp2b.new AnalysisThread().start();
	}
	
	class ReadThread extends Thread{
		
		public void run() {
			String line = null;
			try(Scanner cin = new Scanner(
					Exp2A.class.getClassLoader().getResourceAsStream("fdsdata20181025(0623-0624).txt"))){
				while(cin.hasNext()) {
					line = cin.nextLine();
					blockingDeque.put(line);
					System.out.println("读取 ：" + line);
				}
				blockingDeque.put("STOP");
			}catch(Exception e){
				e.printStackTrace();
			}
		}
	}

	class AnalysisThread extends Thread{

		@Override
		public void run() {
			String line = null;
			while(true) {
				
			}
		}
	}
}